package com.baymax.springboot.cli.config.datasource;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author xiao.hu
 * @date 2021-08-07
 * @apiNote  @ConfigurationProperties 读取配置文件，声明一个类是读取配置类
 */
@Component
@ConfigurationProperties(prefix = "spring.datasource")
public class JdbcProperties {
    private String url;
    private String driverClassName;
    private String username;
    private String password;

    @Override
    public String toString() {
        return String.format("url: %s, driverClassName: %s, username: %s, password: %s",
                url, driverClassName, username, password);
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getDriverClassName() {
        return driverClassName;
    }

    public void setDriverClassName(String driverClassName) {
        this.driverClassName = driverClassName;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
